using System;
using System.ComponentModel.DataAnnotations;

namespace UwinEducation.Application.Dtos
{
    /// <summary>
    /// 系统配置DTO
    /// </summary>
    public class SystemConfigDto
    {
        /// <summary>
        /// 配置ID
        /// </summary>
        public Guid Id { get; set; }

        /// <summary>
        /// 配置键
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 配置值
        /// </summary>
        public string Value { get; set; }

        /// <summary>
        /// 配置描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }

        /// <summary>
        /// 最后更新时间
        /// </summary>
        public DateTime? UpdatedAt { get; set; }
    }



    /// <summary>
    /// 更新系统配置DTO
    /// </summary>
    public class UpdateSystemConfigDto
    {
        /// <summary>
        /// 配置键
        /// </summary>
        [Required(ErrorMessage = "Key不能为空")]
        public string Key { get; set; }
        /// <summary>
        /// 配置值
        /// </summary>
        [Required]
        [MaxLength(1000)]
        public string Value { get; set; }

        /// <summary>
        /// 配置描述
        /// </summary>
        [MaxLength(500)]
        public string? Description { get; set; }

        /// <summary>
        /// 行版本（乐观并发控制）
        /// </summary>
        public byte[]? RowVersion { get; set; }
    }

    /// <summary>
    /// 系统配置键值对DTO
    /// </summary>
    public class ConfigKeyValueDto
    {
        /// <summary>
        /// 配置键
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 配置值
        /// </summary>
        public string Value { get; set; }
    }
}